package com.example.bookkeepingelf.base.enums;

public enum WeekEnum {
    MONDAY("星期一", 1),
    TUESDAY("星期二", 2),
    WEDNESDAY("星期三", 3),
    THURSDAY("星期四", 4),
    FRIDAY("星期五", 5),
    SATURDAY("星期六", 6),
    SUNDAY("星期日", 7);

    private String weekStr;
    private Integer week;

    WeekEnum(String weekStr, Integer week) {
        this.weekStr = weekStr;
        this.week = week;
    }
    public String getWeekStr() {
        return weekStr;
    }

    public Integer getWeek() {
        return week;
    }
    public static WeekEnum getWeekEnum(Integer week) {
        for (WeekEnum weekEnum : WeekEnum.values()) {
            if (weekEnum.getWeek().equals(week)) {
                return weekEnum;
            }
        }
        return null;
    }
}
